package de.schall.rest.di;

import static javax.ws.rs.core.Response.Status.BAD_REQUEST;

import javax.ws.rs.core.Response;
import javax.ws.rs.ext.ExceptionMapper;
import javax.ws.rs.ext.Provider;

@Provider
public class PokemonExceptionMapper implements ExceptionMapper<PokemonException> {

	@Override
	public Response toResponse(PokemonException exception) {
		return Response.status(BAD_REQUEST)
				.entity(exception.getMessage())
				.build();
	}

}
